﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Freya
{
    /// <summary>
    /// 应用程序使用的Freya框架的配置
    /// </summary>
    public static class Config
    {
        /// <summary>
        /// 针对开发人员的调试配置
        /// </summary>
        public static class Debug
        {
            /// <summary>
            ///  debug模式
            /// </summary>
            private static bool debugMode;
            /// <summary>
            /// 获取或设置debug模式开关状态
            /// </summary>
            public static bool DebugMode
            {
                get
                {
                    return debugMode;
                }

                set
                {
                    debugMode = value;
                }
            }
            /// <summary>
            /// 接受要写入的日志的单元对象
            /// </summary>
            private static Unit logWriteObject;
            /// <summary>
            /// 获取或设置接受要写入的日志的单元对象
            /// </summary>
            public static Unit LogWriteObject
            {
                get
                {
                    return logWriteObject;
                }

                set
                {
                    logWriteObject = value;
                }
            }
            /// <summary>
            /// 处理无法解决的异常的单元对象
            /// </summary>
            private static Unit errorHandling;
            /// <summary>
            /// 获取或设置处理无法解决的异常的单元对象
            /// </summary>
            public static Unit ErrorHandling
            {
                get
                {
                    return errorHandling;
                }

                set
                {
                    errorHandling = value;
                }
            }

        }
        /// <summary>
        /// 生命周期配置
        /// </summary>
        public static class Lifecycle
        {
            /// <summary>
            /// 第一启动单元
            /// </summary>
            private static Unit firstUnit;
            /// <summary>
            /// 获取或设置第一个启动的单元
            /// </summary>
            public static Unit FirstUnit
            {
                get
                {
                    return firstUnit;
                }

                set
                {
                    firstUnit = value;
                }
            }
        }
    }
}
